How to: Perform a summary calculation.
Solution:
Click the 'Queries' tab in the Database window, click 'New', and select 'Design View' from the list box. Type the desired summary expression in the 'Field' cell using the 'Sum' function.
1) If the Database window is not active, activate the Database window.
2) Click the 'Queries' tab in the Database window.
Queries tab
3) Click 'New'. (The New Query dialog box appears.)
4) Select 'Design View' in the 'New Query' list box.
5) Click 'OK'. (The Show Table dialog box appears.)
6) Select the table to be used in the query.
7) Click 'Add'. (The table appears behind the dialog box.)
8) Click 'Close'. (The Query design view appears.)
9) To add fields to the query:
a) Select a field from a table's field list box in the top half of the Query Design window.
b) Drag the field to the desired column of the design grid in the bottom half of the Query Design window.
Design grid
c) Release the mouse button. (The field name appears in the Field row, and its table appears in the Table row.)
Field row and Table row
d) Repeat steps 9)a) through 9)c) for each field to be added to the query.
NOTE: Fields can also be added to the query by selecting a field from the drop-down list in the 'Field' row of the design grid in the bottom half of the Query Design window.
Design grid
10) Click in the next blank 'Field' cell in the query grid.
11) Type the desired summary calculation using the following syntax:
ExpressionName:Sum([<field name>]operator[<field name>])
EXAMPLE: TotalUnits:Sum([UnitsInStock]+[UnitsOnOrder])
(where TotalUnits is the output name, [UnitsInStock] is a field name, [UnitsOnOrder] is a field name, and <+> is the operator used in the calculation).
12) Repeat steps 10) and 11) for any additional summary calculations.
13) Select the 'File' menu and select 'Save' to save the query.
14) Select the 'Query' menu and select 'Run' to select the specified records.